/**
 * 全站http配置
 *
 * header参数说明
 * serialize是否开启form表单提交
 * isToken是否需要token
 */
import $ from 'jquery'
import { baseUrl } from '@/config/env'
import { getToken } from '@/utils/auth'

export default {
    load: (link) => {
        let param = {
            type: 'get',
            url: baseUrl + link,
            headers:{},
            async: false,
        }
        const token = getToken()
        if(token)
          param.headers.Authorization = token
        const strJson = $.get(param).responseText

        return JSON.parse(strJson)
    }
}